class Kind < ActiveRecord::Base
  has_and_belongs_to_many :cores, :foreign_key => 'kind_id', :association_foreign_key => 'core_id'
  
  def super_kind locale 
    case locale
      when "en" then self.super_kind_en
      when "it" then self.super_kind_it
    end        
  end
  
  def name locale 
    case locale
      when "en" then self.name_en
      when "it" then self.name_it
    end        
  end
  
  def color
    case self.super_kind_it
          when "cultura"
              "#00CC66"
          when "altro"
              "#00CC66"
          when "musica"
              "#00CCCC"
          when "feste"
              "#CC9900"
          when "cinema"
              "#CC3333"
    end     
  end
  
  
end
